package tr.edu.metu.is.mega.client.course.instructor.students;

import java.util.List;

import tr.edu.metu.is.mega.client.core.SelectionDialog;
import tr.edu.metu.is.mega.client.resource.MEGAResources;
import tr.edu.metu.is.mega.common.dto.CourseDTO;
import tr.edu.metu.is.mega.common.dto.ScheduleTemplateDTO;
import tr.edu.metu.is.mega.common.dto.TeamDTO;

import com.extjs.gxt.ui.client.widget.LayoutContainer;

/**
 * Selection Dialog for {@link ScheduleTemplateDTO} records.
 * 
 */
public class TeamSelectDialog extends SelectionDialog<TeamDTO> {

    private TeamManagementPanel selectWindow;

    /**
     * Default constructor.
     * 
     * @param course course
     */
    public TeamSelectDialog(CourseDTO course) {
        super(false, false, course);
        setHeading(MEGAResources.RESOURCEBUNDLE.teamSelectionHeading());
        setSize(300, 500);

    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected List<TeamDTO> getSelectedItems() {
        return selectWindow.getSelectedItems();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void setSelectedItems(List<TeamDTO> selectedItems) {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected LayoutContainer getSelectionWidget(Object... parameters) {
        selectWindow = new TeamManagementPanel((CourseDTO) parameters[0], true);
        return selectWindow;
    }
}
